package com.financing.service.app;
import java.util.Arrays;
import java.util.Map;

import com.financing.model.app.AppVersion;
import com.financing.model.user.User;
import com.financing.service.BaseService;
import com.jfinal.plugin.activerecord.Page;

public class AppVersionService extends BaseService<User>{

	/**
	 * 检查是否有新版本
	 */
	public AppVersion checkVersion(String system, String type, String code) {
		return AppVersion.me.findFirst("select * from app_version where system=? and type=? and code>?", system, type, code);
	}	
	
	/**
	 * 分页信息
	 * @return
	 */
	public Page<AppVersion> list(int page, int size, Map<String, String> map) {
		return AppVersion.me.paginate(page, size, buildSql("app_version",Arrays.asList("name"),map));
	}
}
